[PLUGIN-1960] Add SMBv2/v3 support to WindowsShareCopy with legacy SMBv1 fallback - #1997
Merged
vikasrathee-cs merged 1 commit intoJul 29, 2026
Conversation
There was a problem hiding this comment.
Code Review
This pull request replaces the legacy jcifs library with smbj in the WindowsShareCopy plugin to support SMBv2 and SMBv3 protocols. This involves updating dependencies in pom.xml and refactoring WindowsShareCopy.java to use SMBClient, Connection, Session, and DiskShare for file operations. The review feedback highlights a resource leak where SMBClient and Session are not properly closed, and suggests using try-with-resources to ensure proper cleanup.
vishwasvaidya-cloudsufi
force-pushed
the
smbj-migration-windows-share-copy
branch
from
July 27, 2026 08:06
5ce492e to
80fd312
Compare
shruthi713
reviewed
Jul 27, 2026
vishwasvaidya-cloudsufi
force-pushed
the
smbj-migration-windows-share-copy
branch
2 times, most recently
from
July 28, 2026 04:46
80bf655 to
6ce7b0d
Compare
shruthi713
approved these changes
Jul 28, 2026
vishwasvaidya-cloudsufi
force-pushed
the
smbj-migration-windows-share-copy
branch
from
July 29, 2026 04:47
d37b541 to
1d559d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kept the legacy jcifs (SMBv1) library to maintain backward compatibility. The plugin dynamically routes to either SMBv1 or SMBv2/v3, defaulting to the newer protocol for all new pipelines.
Key Changes:
Backward Compatibility / UI: Added an SMB Protocol Version dropdown to the UI. New pipelines default to SMBv2/v3. Crucially, if the configuration receives a null value (which happens when existing pipelines are upgraded), the plugin safely falls back to SMBv1 to prevent pipeline breakage.
Dependency Management: Retained jcifs and added smbj along with its explicitly required transitive dependencies (mbassador, asn-one, bcprov) to the pom.xml to ensure CDAP classloader compatibility.
Modern SMB Architecture: Implemented a secure, hierarchical connection lifecycle (Client -> Session -> Share) for the new smbj execution path.
Path Normalization: Added logic to convert UNIX-style forward slashes (/) to Windows-native backslashes () for the smbj share traversal.
Directory Traversal: Implemented explicit directory vs. file traversal logic for SMBv2/v3, including filtering for Windows system pointer directories (. and ..).
Safe File Operations: Applied AccessMask.GENERIC_READ during smbj file operations to prevent accidental file locking on the destination Windows server.